package com.example.minzhengtong.ui

import android.os.Bundle
import android.util.Log
import com.example.minzhengtong.R
import com.example.minzhengtong.base.BaseA
import com.example.minzhengtong.databinding.ActivitySocialInsuranceBBinding
import org.json.JSONArray

class SocialInsuranceB : BaseA() {
    private lateinit var binding: ActivitySocialInsuranceBBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivitySocialInsuranceBBinding.inflate(layoutInflater)
        overridePendingTransition(0, 0)
        setContentView(binding.root)
        initImmerBar(true, R.id.title_bar)
        setToolBarVisiabale(false)
        binding.backBt.setOnClickListener { finish() }
        binding.back.setOnClickListener { finish() }
        Log.d(TAG, "onCreate: " + userBean?.data)
        binding.area.text = userBean?.data?.djbz
        binding.money.text = userBean?.data?.zhye
        binding.cardId.text = userBean?.data?.account_institutions

        val name = "*" + userBean?.data?.uname?.substring(1, userBean?.data?.uname!!.length)
        binding.name.text = name


        val card = userBean?.data?.zjhm
        val card2=card!!.substring(0,2)+"**************"+card!!.substring(15,card.length)
        binding.card.text = card2
        val time = userBean?.data?.khrq
        val sybx = userBean?.data?.sybx
        val ja = JSONArray(sybx)
        val jo = ja.getJSONObject(0)
        val gsmc = jo.getString("gsmc")
        binding.unitName.text = gsmc

        val times = time?.replace("-", "")
        binding.time.text = times
    }

}